﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="personalRecord.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="wrapper" runat="server" Height="688px" Width="981px">
            <asp:Panel ID="header" runat="server" Height="100px" Width="978px">
                <span style="font-size: 32pt; text-decoration: underline"><strong>Govt.Emerson College
                    Multan</strong></span></asp:Panel>
            <asp:Panel ID="subHeader" runat="server" Height="80px" Width="979px">
                <strong><em><span style="font-size: 24pt; text-decoration: underline">Personal Information</span></em></strong></asp:Panel>
            <asp:Panel ID="content" runat="server" Height="233px" Width="328px">
                <asp:Label ID="Label1" runat="server" Text="StdName:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label2" runat="server" Text="Father'sName:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label3" runat="server" Text="Address:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label4" runat="server" Text="DOB:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label5" runat="server" Text="F'sOccupation:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label6" runat="server" Text="NIC:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label7" runat="server" Text="contactNO:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label8" runat="server" Text="EmailID:" Width="100px"></asp:Label>
                <asp:TextBox ID="TextBox8" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label9" runat="server" Text="Gender" Width="100px"></asp:Label>
                <asp:RadioButton ID="RadioButton1" runat="server" Text="Female" />
                <asp:RadioButton ID="RadioButton2" runat="server" Text="Male" /><br />
                <asp:Button ID="Button1" runat="server" Text="Reset" Width="66px" />
                <asp:Button ID="Button2" runat="server" Text="Next" Width="66px" /><br />
                <br />
                &nbsp;<br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:AdmissionSystemConnectionString1 %>" 
                    DeleteCommand="DELETE FROM [personalRecord] WHERE [stdID] = @original_stdID AND (([stdName] = @original_stdName) OR ([stdName] IS NULL AND @original_stdName IS NULL)) AND (([SFname] = @original_SFname) OR ([SFname] IS NULL AND @original_SFname IS NULL)) AND (([address] = @original_address) OR ([address] IS NULL AND @original_address IS NULL)) AND (([DOB] = @original_DOB) OR ([DOB] IS NULL AND @original_DOB IS NULL)) AND (([Foccuption] = @original_Foccuption) OR ([Foccuption] IS NULL AND @original_Foccuption IS NULL)) AND (([contactNo] = @original_contactNo) OR ([contactNo] IS NULL AND @original_contactNo IS NULL)) AND (([permanentAddress] = @original_permanentAddress) OR ([permanentAddress] IS NULL AND @original_permanentAddress IS NULL)) AND (([userID] = @original_userID) OR ([userID] IS NULL AND @original_userID IS NULL)) AND (([NIC] = @original_NIC) OR ([NIC] IS NULL AND @original_NIC IS NULL))" 
                    InsertCommand="INSERT INTO [personalRecord] ([stdName], [SFname], [address], [DOB], [Foccuption], [contactNo], [permanentAddress], [userID], [NIC]) VALUES (@stdName, @SFname, @address, @DOB, @Foccuption, @contactNo, @permanentAddress, @userID, @NIC)" 
                    ProviderName="<%$ ConnectionStrings:AdmissionSystemConnectionString1.ProviderName %>" 
                    SelectCommand="SELECT * FROM [personalRecord]" 
                    
                    UpdateCommand="UPDATE [personalRecord] SET [stdName] = @stdName, [SFname] = @SFname, [address] = @address, [DOB] = @DOB, [Foccuption] = @Foccuption, [contactNo] = @contactNo, [permanentAddress] = @permanentAddress, [userID] = @userID, [NIC] = @NIC WHERE [stdID] = @original_stdID AND (([stdName] = @original_stdName) OR ([stdName] IS NULL AND @original_stdName IS NULL)) AND (([SFname] = @original_SFname) OR ([SFname] IS NULL AND @original_SFname IS NULL)) AND (([address] = @original_address) OR ([address] IS NULL AND @original_address IS NULL)) AND (([DOB] = @original_DOB) OR ([DOB] IS NULL AND @original_DOB IS NULL)) AND (([Foccuption] = @original_Foccuption) OR ([Foccuption] IS NULL AND @original_Foccuption IS NULL)) AND (([contactNo] = @original_contactNo) OR ([contactNo] IS NULL AND @original_contactNo IS NULL)) AND (([permanentAddress] = @original_permanentAddress) OR ([permanentAddress] IS NULL AND @original_permanentAddress IS NULL)) AND (([userID] = @original_userID) OR ([userID] IS NULL AND @original_userID IS NULL)) AND (([NIC] = @original_NIC) OR ([NIC] IS NULL AND @original_NIC IS NULL))" 
                    ConflictDetection="CompareAllValues" 
                    OldValuesParameterFormatString="original_{0}">
                    <DeleteParameters>
                        <asp:Parameter Name="original_stdID" Type="Int32" />
                        <asp:Parameter Name="original_stdName" Type="String" />
                        <asp:Parameter Name="original_SFname" Type="String" />
                        <asp:Parameter Name="original_address" Type="String" />
                        <asp:Parameter DbType="Date" Name="original_DOB" />
                        <asp:Parameter Name="original_Foccuption" Type="String" />
                        <asp:Parameter Name="original_contactNo" Type="Int32" />
                        <asp:Parameter Name="original_permanentAddress" Type="String" />
                        <asp:Parameter Name="original_userID" Type="String" />
                        <asp:Parameter Name="original_NIC" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="stdName" Type="String" />
                        <asp:Parameter Name="SFname" Type="String" />
                        <asp:Parameter Name="address" Type="String" />
                        <asp:Parameter  Name="DOB" DbType="Date"  />
                        <asp:Parameter Name="Foccuption" Type="String" />
                        <asp:Parameter Name="contactNo" Type="Int32" />
                        <asp:Parameter Name="permanentAddress" Type="String" />
                        <asp:Parameter Name="userID" Type="String" />
                        <asp:Parameter Name="NIC" Type="Int32" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="stdName" Type="String" />
                        <asp:Parameter Name="SFname" Type="String" />
                        <asp:Parameter Name="address" Type="String" />
                        <asp:Parameter DbType="Date" Name="DOB" />
                        <asp:Parameter Name="Foccuption" Type="String" />
                        <asp:Parameter Name="contactNo" Type="Int32" />
                        <asp:Parameter Name="permanentAddress" Type="String" />
                        <asp:Parameter Name="userID" Type="String" />
                        <asp:Parameter Name="NIC" Type="Int32" />
                        <asp:Parameter Name="original_stdID" Type="Int32" />
                        <asp:Parameter Name="original_stdName" Type="String" />
                        <asp:Parameter Name="original_SFname" Type="String" />
                        <asp:Parameter Name="original_address" Type="String" />
                        <asp:Parameter DbType="Date" Name="original_DOB" />
                        <asp:Parameter Name="original_Foccuption" Type="String" />
                        <asp:Parameter Name="original_contactNo" Type="Int32" />
                        <asp:Parameter Name="original_permanentAddress" Type="String" />
                        <asp:Parameter Name="original_userID" Type="String" />
                        <asp:Parameter Name="original_NIC" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <asp:FormView ID="FormView1" runat="server" DataKeyNames="stdID" 
                    DataSourceID="SqlDataSource1" DefaultMode="Insert">
                    <EditItemTemplate>
                        stdID:
                        <asp:Label ID="stdIDLabel1" runat="server" Text='<%# Eval("stdID") %>' />
                        <br />
                        stdName:
                        <asp:TextBox ID="stdNameTextBox" runat="server" Text='<%# Bind("stdName") %>' />
                        <br />
                        SFname:
                        <asp:TextBox ID="SFnameTextBox" runat="server" Text='<%# Bind("SFname") %>' />
                        <br />
                        address:
                        <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' />
                        <br />
                        DOB:
                        <asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Bind("DOB") %>' />
                        <br />
                        Foccuption:
                        <asp:TextBox ID="FoccuptionTextBox" runat="server" 
                            Text='<%# Bind("Foccuption") %>' />
                        <br />
                        contactNo:
                        <asp:TextBox ID="contactNoTextBox" runat="server" 
                            Text='<%# Bind("contactNo") %>' />
                        <br />
                        permanentAddress:
                        <asp:TextBox ID="permanentAddressTextBox" runat="server" 
                            Text='<%# Bind("permanentAddress") %>' />
                        <br />
                        userID:
                        <asp:TextBox ID="userIDTextBox" runat="server" Text='<%# Bind("userID") %>' />
                        <br />
                        NIC:
                        <asp:TextBox ID="NICTextBox" runat="server" Text='<%# Bind("NIC") %>' />
                        <br />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        stdName:
                        <asp:TextBox ID="stdNameTextBox" runat="server" Text='<%# Bind("stdName") %>' />
                        <br />
                        SFname:
                        <asp:TextBox ID="SFnameTextBox" runat="server" Text='<%# Bind("SFname") %>' />
                        <br />
                        address:
                        <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' />
                        <br />
                        DOB:
                        <asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Bind("DOB") %>' />
                        <asp:CalendarExtender ID="DOBTextBox_CalendarExtender" runat="server" 
                            Enabled="True" TargetControlID="DOBTextBox">
                        </asp:CalendarExtender>
                        <br />
                        Foccuption:
                        <asp:TextBox ID="FoccuptionTextBox" runat="server" 
                            Text='<%# Bind("Foccuption") %>' />
                        <br />
                        contactNo:
                        <asp:TextBox ID="contactNoTextBox" runat="server" 
                            Text='<%# Bind("contactNo") %>' />
                        <br />
                        permanentAddress:
                        <asp:TextBox ID="permanentAddressTextBox" runat="server" 
                            Text='<%# Bind("permanentAddress") %>' />
                        <br />
                        userID:
                        <asp:TextBox ID="userIDTextBox" runat="server" Text='<%# Bind("userID") %>' />
                        <br />
                        NIC:
                        <asp:TextBox ID="NICTextBox" runat="server" Text='<%# Bind("NIC") %>' />
                        <br />
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="Insert" />
                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        stdID:
                        <asp:Label ID="stdIDLabel" runat="server" Text='<%# Eval("stdID") %>' />
                        <br />
                        stdName:
                        <asp:Label ID="stdNameLabel" runat="server" Text='<%# Bind("stdName") %>' />
                        <br />
                        SFname:
                        <asp:Label ID="SFnameLabel" runat="server" Text='<%# Bind("SFname") %>' />
                        <br />
                        address:
                        <asp:Label ID="addressLabel" runat="server" Text='<%# Bind("address") %>' />
                        <br />
                        DOB:
                        <asp:Label ID="DOBLabel" runat="server" Text='<%# Bind("DOB") %>' />
                        <br />
                        Foccuption:
                        <asp:Label ID="FoccuptionLabel" runat="server" 
                            Text='<%# Bind("Foccuption") %>' />
                        <br />
                        contactNo:
                        <asp:Label ID="contactNoLabel" runat="server" Text='<%# Bind("contactNo") %>' />
                        <br />
                        permanentAddress:
                        <asp:Label ID="permanentAddressLabel" runat="server" 
                            Text='<%# Bind("permanentAddress") %>' />
                        <br />
                        userID:
                        <asp:Label ID="userIDLabel" runat="server" Text='<%# Bind("userID") %>' />
                        <br />
                        NIC:
                        <asp:Label ID="NICLabel" runat="server" Text='<%# Bind("NIC") %>' />
                        <br />
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" />
                        &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                            CommandName="New" Text="New" />
                    </ItemTemplate>
                </asp:FormView>
                <br />
                <br />
                <br />
            </asp:Panel>
            <br />
            <br />
            <br />
         
        </asp:Panel>
    
    </div>
         
    <br />
    <br />
    <br />
    </form>
</body>
</html>
